package com.woniuxy.his.controller;


import com.woniuxy.his.common.Result;
import com.woniuxy.his.controller.form.AddImageCheckForm;
import com.woniuxy.his.service.IBloodCheckService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 血液检查表 前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2021-08-28
 */
@RestController
//@RequestMapping("/his/blood-check")
@Slf4j
@CrossOrigin("*")
public class BloodCheckController {

    @Resource
    private IBloodCheckService bloodCheckService;

    /**
     * 血常规检查详情表
     * @return
     */
    @PutMapping("/formSubmission")
    public Result formSubmission(@RequestBody AddImageCheckForm addImageCheckForm){
        log.info("血常规结果前端传入数据：{}",addImageCheckForm);

        Boolean aBoolean = bloodCheckService.formSubmissionByCaseId(addImageCheckForm);

        return aBoolean ? Result.success("20000", "血常规结果生成成功！", null) : Result.fail("40004", "数据库繁忙！", null);
    }
}

